<!doctype html>
<html xmlns:gs="http://www.gensee.com/ec">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta content="black-translucent" name="apple-mobile-web-app-status-bar-style">
    <title>登录</title>
    <link href="/public/static/css/main.css" rel="stylesheet">
    <script src="/public/static/js/jquery.js"></script>
    <script src="/public/static/js/webconfig.js"></script>
    <script src="/public/static/js/common.js" charset="utf-8"></script>
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="//cdn.bootcss.com/html5shiv/r29/html5.js"></script>
    <![endif]-->
</head>
<body id="loginbody">
<div class="header">
    <div class="grid-1000 l-head">
        <a href="" class="l-logo"><img src="static/img/l-logo.jpg" /></a>
        <span class="l-word">系统 —— 登录</span>
        <span class="l-tel">Tel:400 - 921 - 3087</span>
    </div>
</div>
<div class="login-content">
<div class="grid-1000">
<div class="right_l_r">
	<ul class="tab_l_r tabul"><li class="active">用户登录</li></ul>
    <div class="loginbox tabbox active">
        <div class="ui-login-prompt"></div>
    	<div class="input-line">
        	<input type="text" class="ui-text ui-w-270" id="userName" placeholder="请输入邮箱/手机号">
        </div>
        <div class="input-line">
        <input type="password" class="ui-text ui-w-270" id="passWord" placeholder="请输入您的密码">
        </div>
        <div class="input-line">
        <input type="button" value="登录" onClick="checklogin()" class="ui-button">
        </div>
    </div>
</div>
</div>

</div>
<div class="footer">
    <div class="grid-1000">
        <div class="f-link"><a href="">新手指南</a>|<a href="">帮助中心</a>|<a href="">关于我们</a>|<a href="">联系我们</a>|<a href="">意见反馈</a></div>
        <div class="">24小时服务热线：400-921-3078 Email:service@zhikao100.com 工作时间：9:00-17:30</div>
        <div class="">&copy;2003-2015 职考100网 版权所有 沪ICP备案15030190号</div>
    </div>
</div>
<script type="text/javascript">
function checklogin(){
	var name = $("#userName").val(); 
	var pw = $("#passWord").val();
	if(name==""){
		$(".ui-login-prompt").html("请输入用户名").show();
		return false;
	}
	if(pw==""){
		$(".ui-login-prompt").html("请输入密码").show();
		return false;
	}
	loginFun(name,pw)
}
function loginFun(name,pw){
	var url = webconfig.apihost+"?c=api&a=login&callback=?";
	var data = {"username":name,"passwd":pw};
	$.getJSON(url,data,function(respons){
	  if(respons.code==1){
         if(respons.results.isteacher == 1){
            window.open(respons.results.teacher_url,"_self");
            return
         }
         window.open(webconfig.pagehost+"?room="+ respons.results.roomkey,"_self")
	  }
	  else{
		$(".ui-login-prompt").html(respons.message).show();   
	  }
	})
}

function showPrompt(objid,mes){
    $("#"+objid).siblings(".ui-prompt").html(mes).show();
}
</script>

</body>
</html>

